<?php
namespace app\article\model;

use \app\common\library\Model;

class Admiration extends Model
{
    protected $type = [
        'licence' => 'json',
    ];


    protected $append = [
    	'status_text'
    ];

    public function getStatusTextAttr($value, $data) {
    	$arr = ['0' => '已取消', '1' => '已点赞'];
        if (isset($data['status'])) {
            return $arr[$data['status']];
        }
    	return '';
    }

    //获取客户信息
    public function custom() {
        return $this->hasOne('app\\custom\\model\\Custom','current_id', 'current_id');
    }

    //获取站点信息
    public function site() {
        return $this->hasOne('app\\site\\model\\Site','id', 'site_id');
    }

}
